package org.andolphin.client;

import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.MediumTest;
import android.view.KeyEvent;
import android.widget.Button;
import android.widget.EditText;

public class RegisterActivityTest extends ActivityInstrumentationTestCase2<RegisterActivity> {

    private EditText usernameEdit;

    /**
     * The first constructor parameter must refer to the package identifier of the
     * package hosting the activity to be launched, which is specified in the AndroidManifest.xml
     * file.  This is not necessarily the same as the java package name of the class - in fact, in
     * some cases it may not match at all.
     */
    public RegisterActivityTest() {
        super("org.andolphin.client", RegisterActivity.class);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        final RegisterActivity activity = getActivity();
        usernameEdit = (EditText) activity.findViewById(R.id.edit_register_username);
    }

    /**
     * The name 'test preconditions' is a convention to signal that if this
     * test doesn't pass, the test case was not set up properly and it might
     * explain any and all failures in other tests.  This is not guaranteed
     * to run before other tests, as junit uses reflection to find the tests.
     */
    @MediumTest
    public void testPreconditions() {
        usernameEdit.setText("aa");
    }

}
